#ifndef COMMANDLIB_H
#define COMMANDLIB_H

#define CURSORHW 2
#define CURSOR_INIT_R 78
#define CURSOR_INIT_C  118
#define FIRST_CITY_R 140
#define FIRST_CITY_C 30
#define CITY_BUFFER 20
#define SILO_C 5
#define INIT_COUNTER_MISSILES 25
#define INIT_ENEMY_MISSILES 20
#define INIT_CITIES 3
#define ABS(x) (((x)<0) ? - (x):(x))
#define EXPLOSIONHW 10

typedef enum CityStatus {ALIVE,DEAD} cityStatus;
typedef enum MissileStatus {UNFIRED, ACTIVE, EXPLODED,FIRED} missileStatus;

typedef struct cityStruct
{
	int r;
	int c;
	cityStatus status;
} City;

typedef struct missileStruct
{
	int r;
	int c;
	int r1;
	int c1;
	int eTime;
	missileStatus status;
} Missile;

typedef struct cursorStruct
{
	int r;
	int c;
} Cursor;

typedef struct expl
{
    int r;
    int c;
} Explosion;

typedef struct launchPoint
{
	int r;
	int c;
} LaunchPoint;

void newGame();
void fireCounterMissile();
void updateMissiles();
void updateCounterMissiles();
void checkCollisions();
void checkLoseConditions();
void checkWinConditions();
void cursorLeft();
void cursorRight();
void cursorUp();
void cursorDown();
void drawCursor();
int calculateScore();
void drawScreen();
void drawGround();
void drawLine(int c0, int c1, int r0, int r1);
void drawMissiles();
void attemptEnemyMissile();

#endif
